﻿<%@ Register TagPrefix="uc1" TagName="PageNavigation" Src="../UserControls/PageNavigation.ascx" %>
<%@ Register TagPrefix="cc1" Namespace="BEGDC.CC.Web.Control" Assembly="ASBCC.Web" %>

<%@ Page Language="c#" CodeBehind="MyProperty.aspx.cs" AutoEventWireup="false" Inherits="BEGDC.CC.Web.MyProperty" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title></title>
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="../css/content/entity.css" rel="stylesheet" type="text/css" />
    
    <style>
        #tab { height: auto; }
        #tab table { position: relative; }
        #tab div { display: block; height: auto; }
        .db_cols_style1 TD SPAN { float: none; padding: 0px; }
    </style>

    <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../js/jquery-ui.min.js" type="text/javascript"></script>

    <script src="../js/entity.js.aspx" type="text/javascript"></script>

    <script src="../js/common.js" type="text/javascript"></script>

    <script type="text/javascript">
        function showDialog(url) {

            var obj = window.showModalDialog(url, this, 'dialogHeight:330px;dialogWidth:544px;dialogTop:px;dialogLeft:px;center:Yes;scroll:no;resizable:yes;status:no;');
            if (obj == 'reload') {
                //document.Form1.submit();

                window.location.href = window.location.href;
            }
        }

        $(function() {
            $("#tab").tabs();
            
            $(".badlink").bind("click", function(){
                $.globalEval($(this).attr("jcode"));
            });

            //$("#li-tab-delegate").hide();
            //$("#li-tab-delegated").hide();
            //$("#li-tab-ezvisit").hide();
            
            if(!<%=IsCCSUser() %>){
                $("#li-tab-delegate").hide();
                $("#li-tab-delegated").hide();
            }
            if(!<%=IsEZVisitUser() %>){
                $("#li-tab-ezvisit").hide();
            }
            
        });
    </script>

</head>
<body>
    <form id="Form1" method="post" runat="server" class="mainbox">
    <div class="mainbox">
         <div class="sitemapbox">
            <div id="info" class="sitemap">
                &nbsp;&raquo;&nbsp;Home&nbsp;&raquo;&nbsp; My Property
            </div>
        </div>
        <table id="Table4" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <!--tab区域-->
                    <div class="tabbox purplebg_dark">
                        <ul class="tabpos">
                            <li><span class="tab_active"><%=Resources.PageTitles.MyProperty %></span></li>
                        </ul>
                    </div>
                    <div class="formbox padding_lft5">
                        <span class=" float_lft padding_lft20">
                            <img src="../images/Icon.gif" alt="icon" />&nbsp;My Property </span>
                    </div>
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <table cellpadding="0" cellspacing="0" id="Table2" class="db_cols_style1" style="width: 900px">
                        <tr>
                            <td class="txt_align_rgt">
                                Account:<br />
                                帐号
                            </td>
                            <td>
                                <asp:Label ID="lblLogin" runat="server">lblLogin</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="txt_align_rgt">
                                Engilish Name:<br />
                                英文名
                            </td>
                            <td>
                                <asp:Label ID="lblName" runat="server">lblName</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="txt_align_rgt">
                                Chinese Name:<br />
                                中文名
                            </td>
                            <td>
                                <asp:Label ID="lblNameChinese" runat="server">lblNameChinese</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="txt_align_rgt">
                                Department:<br />
                                部门
                            </td>
                            <td>
                                <asp:Label ID="lblDepartment" runat="server">lblDepartment</asp:Label>
                            </td>
                        </tr>
                         <tr>
                            <td class="txt_align_rgt">
                                Role:<br />
                                角色
                            </td>
                            <td>
                               <div id="tab" style="margin-left: 15px;">
                                   <ul>
                                       <li><a href="#tab-role">Roles (角色)</a></li>
                                       <li id="li-tab-delegate"><a href="#tab-delegate">Delegation (代理)</a></li>
                                       <li id="li-tab-delegated"><a href="#tab-delegated">Delegated (被代理)</a></li>
                                       <li id="li-tab-ezvisit"><a href="#tab-ezvisit">Process Proxy (流程代理)</a></li>
                                   </ul>
                                   <div id="tab-role">
                                       <asp:Repeater ID="rptRoles" runat="server">
                                           <ItemTemplate>
                                               <div><span style="float: none; padding-left: 0px;"><%--<b><%#Eval("BelongsTo") %></b>--%></span> <span style="float: none; padding-left: 0px;"><%--<%#Eval("Name") %> [--%><%#Eval("Description") %><%--]--%></span> <span style="float: none; padding-left: 0px;" class="<%#GetRoleStyle(Eval("IsAdmin")) %>"></span></div>
                                           </ItemTemplate>
                                       </asp:Repeater>
                                   </div>
                                   <div id="tab-delegate">
                                        <asp:DataGrid ID="dgRoles" ShowHeader="True" AutoGenerateColumns="False" GridLines="both"
                                        CellPadding="0" runat="server" PageSize="10" AllowPaging="False" PagerStyle-Visible="False"
                                        CssClass="tablestyle" Width="100%">
                                        <SelectedItemStyle></SelectedItemStyle>
                                        <ItemStyle CssClass="tbody"></ItemStyle>
                                        <HeaderStyle CssClass="thead"></HeaderStyle>
                                        <FooterStyle></FooterStyle>
                                        <Columns>
                                            <asp:BoundColumn Visible="False" DataField="UserRoleID"></asp:BoundColumn>
                                            <asp:BoundColumn DataField="RoleDescription" ReadOnly="True" HeaderText="Role<br />角色">
                                                <ItemStyle></ItemStyle>
                                            </asp:BoundColumn>
                                            <asp:BoundColumn DataField="NameEN" ReadOnly="True" HeaderText="Delegation<br />代理">
                                                <ItemStyle></ItemStyle>
                                            </asp:BoundColumn>
                                            <asp:BoundColumn DataField="DelegateStartDate" ReadOnly="True" HeaderText="Start Date<br />开始日期"
                                                DataFormatString="{0:M/d/yyyy}">
                                                <ItemStyle></ItemStyle>
                                            </asp:BoundColumn>
                                            <asp:BoundColumn DataField="DelegateEndDate" ReadOnly="True" HeaderText="End Date<br />结束日期"
                                                DataFormatString="{0:M/d/yyyy}">
                                                <ItemStyle></ItemStyle>
                                            </asp:BoundColumn>
                                            <asp:BoundColumn DataField="IsEnabled" ReadOnly="True" HeaderText="Delegation Enabled<br />激活代理"
                                                DataFormatString="{0:M/d/yyyy}">
                                                <ItemStyle></ItemStyle>
                                            </asp:BoundColumn>
                                            <asp:TemplateColumn HeaderText="Action<br />操作">
                                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                <ItemTemplate>
                                                    <img src="../Images/COMEDIT.GIF" alt="COMEDIT" class="badlink" jcode="javascript:showDialog('MyDelegation.aspx?roleid=<%# DataBinder.Eval(Container.DataItem,"UserRoleID") %>',null, 'dialogHeight:300px;dialogWidth:400px;status:no;scroll:no;resizable:no;') ;"
                                                        style="cursor: pointer" title="Edit (编辑)" />
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                            <asp:TemplateColumn HeaderText="Cancel<br />取消">
                                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:ImageButton ImageUrl="../Images/icon_Delete.gif" ID="ImageDelete" CommandName="btnDelete"
                                                        runat="server" ToolTip="Delete (删除)"></asp:ImageButton>
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                        </Columns>
                                        <PagerStyle Visible="False"></PagerStyle>
                                    </asp:DataGrid>
                                </div>
                                <div id="tab-delegated">
                                    <asp:DataGrid ID="dgDelegated" ShowHeader="True" AutoGenerateColumns="False" GridLines="both"
                                    CellPadding="2" runat="server" PageSize="10" AllowPaging="True" PagerStyle-Visible="False"
                                    CssClass="tablestyle" Width="100%">
                                    <SelectedItemStyle></SelectedItemStyle>
                                    <ItemStyle CssClass="tbody"></ItemStyle>
                                    <HeaderStyle CssClass="thead"></HeaderStyle>
                                    <FooterStyle></FooterStyle>
                                    <Columns>
                                        <asp:BoundColumn DataField="NameEN" ReadOnly="True" HeaderText="Delegation<br />代理">
                                            <ItemStyle></ItemStyle>
                                        </asp:BoundColumn>
                                        <asp:BoundColumn DataField="RoleName" ReadOnly="True" HeaderText="Role<br />角色">
                                            <ItemStyle></ItemStyle>
                                        </asp:BoundColumn>
                                        <asp:BoundColumn DataField="DelegateStartDate" ReadOnly="True" HeaderText="Start Date<br />开始日期"
                                            DataFormatString="{0:M/d/yyyy}">
                                            <ItemStyle></ItemStyle>
                                        </asp:BoundColumn>
                                        <asp:BoundColumn DataField="DelegateEndDate" ReadOnly="True" HeaderText="End Date<br />结束日期"
                                            DataFormatString="{0:M/d/yyyy}">
                                            <ItemStyle></ItemStyle>
                                        </asp:BoundColumn>
                                        <asp:BoundColumn DataField="IsEnabled" ReadOnly="True" HeaderText="Delegation Enabled<br />激活代理"
                                            DataFormatString="{0:M/d/yyyy}">
                                            <ItemStyle></ItemStyle>
                                        </asp:BoundColumn>
                                        <asp:BoundColumn Visible="False" DataField="UserRoleID"></asp:BoundColumn>
                                    </Columns>
                                    <PagerStyle Visible="False"></PagerStyle>
                                </asp:DataGrid>
                                </div>
                                <div id="tab-ezvisit" style="display:none">
                                    <table cellpadding="0" cellspacing="0" class="tablestyle" width="100%">
                                    <tr class="thead">
                                        <td>
                                        </td>
                                        <td>
                                            Delegation<br />
                                            审批代理人
                                        </td>
                                        <td>
                                            Start Date<br />
                                            开始日期
                                        </td>
                                        <td>
                                            End Date<br />
                                            结束日期
                                        </td>
                                        <td>
                                            Action<br />
                                            操作
                                        </td>
                                        <td>
                                            Cancel<br />
                                            取消
                                        </td>
                                    </tr>
                                    <tr class="tbody">
                                        <td>
                                            EZ Visit
                                        </td>
                                        <td>
                                            <asp:Label ID="lblss1" runat="server"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblDateFrom1" runat="server"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblDateTo1" runat="server"></asp:Label>
                                        </td>
                                        <td>
                                            <img src="../Images/COMEDIT.GIF" alt="COMEDIT" 
                                            class="badlink" jcode="javascript:showDialog('ProcessDelegation.aspx?EmployeeID=<%= UserInfo.EmployeeID %>&rdm=<%= System.Guid.NewGuid() %>',,dialogHeight:250px;dialogWidth:400px;status:noscroll:no;resizable:no;);"
                                                style="cursor: pointer" title="Edit (编辑)" />
                                        </td>
                                        <td>
                                            <asp:HiddenField ID="hidGuid1" runat="server" />
                                            <asp:ImageButton ID="btnDel1" runat="server" ImageUrl="../images/del.gif" ImageAlign="absmiddle"
                                                OnClick="btnDel1_Click" title="Cancel (取消)"></asp:ImageButton>
                                        </td>
                                    </tr>
                                </table>
                                </div>
                               </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </form>
    
       <%--页面刷新时显示--%>
    <div id="dialog-message" title="Loading..." style="display: none">
        <p>
            <br />
            <span class="entity-loading"></span><span>Operation in process, please wait...<br />
                <br />
                处理中, 请稍候。。。</span>
        </p>
    </div>
</body>
</html>
